<%@ include file="/common/taglibs.jsp"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>" type="text/css" />
		<link rel="stylesheet" href="<c:url value='/scripts/themes/base/jquery.ui.all.css'/>" type="text/css" />
	</head>
	<body>
		<div class="head_content" id="headBar" style="">
			<div id="finder-action-d506cc" class="finder-action">
				<div class="finder-action-inner clearfix">
					<button class="btn btn-large" onclick="location.href ='gd_cat_add.html'" type="button">
						<span><span><i class="finder-icon"><img style="width: 24px; height: 24px; background-position: 0pt -316px;" class="imgbundle icon"
										src="<c:url value="/images/transparent.gif"/>" /> </i><fmt:message key="gd_cat.add" /></span> </span>
					</button>
					<button class="btn" onclick="location.reload()" type="button">
						<span> <span> <i class="finder-icon"> <img style="width: 22px; height: 24px; background-position: 0pt -644px;" class="imgbundle icon"
										src="<c:url value="/images/transparent.gif"/>" /> </i> <fmt:message key="button.refresh" /> </span> </span>
					</button>

				</div>
			</div>
			<div class="gridlist-head mainHead">
				<div class="span-8">
					<fmt:message key="gd_cat.name" />
				</div>
				<div class="span-4">
					<fmt:message key="gd_cat.type" />
				</div>
				<div class="span-2">
					<fmt:message key="gd_cat.add_sub" />
				</div>
				<div class="span-2">
					<fmt:message key="button.edit" />
				</div>
				<div class="span-2">
					<fmt:message key="button.delete" />
				</div>
				<div class="span-2">
					<fmt:message key="button.view" />
				</div>
				<div class="span-2">
					<fmt:message key="button.view" />
				</div>
			</div>
		</div>


		<div class="main_content" id="main" >
			<form method="post"  action="">
				<div class="gridlist" id="cat_tree">
					<c:forEach var="list" items="${goodsCats}">
						<div class="clear_cat row">
							<div class="row-line">
								<div style="text-align: left ! important;" class="span-8">
									<div style="margin-left: ${list.depth*25 }px;">
										<fmt:message key="common.sort" />
										<input   value="${list.showOrder }" name="list.showOrder" size="2" class="_x_ipt" style="display: inline;" />
										<span style="color: rgb(51, 102, 153); padding-right: 15px;" class="lnk">${list.catName}</span>
									</div>
								</div>
								<div class="span-4">
									<span style="padding: 0pt 5px;" class="quiet">${list.typeName}</span>
								</div>
								<div class="span-2">
									<span class="opt" onclick='location.href="gd_cat_add.html?parentCatId=${list.catId}"'><img border="0" style="width: 16px; height: 16px; background-position: 0pt 0px;"
											class="imgbundle"   src="<c:url value="/images/transparent.gif"/>" /> </span>
								</div>
								<div class="span-2">
									<span class="opt" onclick='location.href="gd_cat_edit.html?catId=${list.catId}"'><img border="0" style="width: 16px; height: 16px; background-position: 0pt -284px;" class="imgbundle"
											 src="<c:url value="/images/transparent.gif"/>" /> </span>
								</div>
								<div class="span-2">
									<span class="opt" onclick='del(this,"${list.catId}")'><img border="0" style="width: 16px; height: 16px; background-position: 0pt -214px;" class="imgbundle"  
											src="<c:url value="/images/transparent.gif"/>" /> </span>
								</div>
								<div class="span-2">
									<span class="opt"><img border="0" style="width: 16px; height: 16px; background-position: 0pt -2025px;" class="imgbundle"   src="<c:url value="/images/transparent.gif"/>" />
									</span>
								</div>
								<div class="span-2">
									<span class="opt"><img border="0" style="width: 18px; height: 19px; background-position: 0pt -2535px;" class="imgbundle"   src="<c:url value="/images/transparent.gif"/>" />
									</span>
								</div>
							</div>
						</div>
					</c:forEach>
				</div>
			</form>
		</div>
		<div class="foot_content" id="footBar" style="">
			<div class="footer">
				<table cellspacing="0" cellpadding="0" border="0" align="center" class="table-action">
					<tbody>
						<tr>
							<td>
								<fmt:message key="page.total" >
									<fmt:param>${fn:length(goodsCats)}</fmt:param>
								</fmt:message>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div id="effect" class="not_delete">
			 <fmt:message key="gd_cat.not_last_level" />
		</div>

		<script type="text/javascript" src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script> 
		<%@ include file="/jsp/admin/common/messages.jsp"%>
		<script type="text/javascript">
	 
	function del(obj, catId) {
		if (catId != 0) {
			deleteCat(obj, catId);

		} else if (catId == null) {

		}

	}

	function deleteCat(obj, catId) {
		var url = "gd_cat_delete.html";
		var params = {
			"catId" : catId
		};

		$.getJSON(url, params, function callback(data) {
			var reason = data.reason;
			showCallbackResult(reason);
			if (reason != '<fmt:message key="gd_cat.deleted_not_allowed" />') {				 
				$(obj).parent().parent().parent().remove();
			}

		});
	}
</script>



	</body>


</html>

